<!DOCTYPE html>
<html lang="zh-cmn-Hans-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>历史PB资料</title>
    <!-- Bootstrap core CSS -->
    <link href="<?php echo base_url('application/views/bootstrap/css/bootstrap.css'); ?>" rel="stylesheet">
    <!-- 自定义样式表 -->
    <link href="<?php echo base_url('application/views/css/stock.css'); ?>" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="<?php echo base_url('application/views/jQuery/jquery-2.2.3.min.js'); ?>"></script>
    <script src="<?php echo base_url('application/views/bootstrap/js/bootstrap.js'); ?>"></script>
    <!-- 引入layer插件，实现增强web弹窗和层效果 -->
    <script src="<?php echo base_url('application/views/layer/layer.js'); ?>"></script>
</head>

<body class="popbody">
    <div class="container-fluid">
        <div class="pop">
            <p><img src="<?php echo $url ?>"></p>
            <!-- 输入高低PB的文本框 -->
            <form class="form-inline">
                <div class="form-group">
                    <label>历史低值</label>
                    <input type="text" class="form-control" name="lowpb">
                </div>
                <div class="form-group">
                    <label>历史高值</label>
                    <input class="form-control" name="toppb">
                </div>
                <input type="hidden" name="scode" value="<?php echo $scode ?>">
                <button type="submit" class="btn btn-default">更新</button>
            </form>
        </div>
    </div>
    <script>
    $(document).ready(function() {
        $('button').click(function() {
            // 使用Ajax请求发送表单数据。
            $.post("<?php echo site_url('selected/updateHistoryPB')?>", $(".form-inline").serialize(), function(data, status) {
                // 更改父页面的内容
                var sPBhis = "tr[id*='" + $('input[name="scode"]').attr('value') + "']" + " td.pbRange";
                var tPBhis = $('input[name="lowpb"]').val() + '-' + $('input[name="toppb"]').val();
                // 设定父页面内容
                parent.$(sPBhis).text(tPBhis);
                // console.log("数据：" + data + "\n状态：" + status);
                // 先得到当前iframe层的索引
                var index = parent.layer.getFrameIndex(window.name);
                // 再执行关闭
                parent.layer.close(index);
            });
            // 阻止提交按钮的默认行为
            return false;
        });
    });
    </script>
</body>

</html>
